/**
 * 
 */
package com.chitranshu.sample;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.chitranshu.activities.BaseTabActivity;

/**
 * @author anshu
 * 
 */
public class Activity1 extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Button button = new Button(this);
		button.setText("Launch another child activity");
		button.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				getParent().startActivityFromChild(
						Activity1.this,
						new Intent(Activity1.this, Activity2.class).putExtra(
								BaseTabActivity.EXTRA_START_AS_CHILD, true), 0);
			}
		});
		setContentView(button);
	}

	@Override
	protected void onPause() {
		System.out.println("Activity1::onPause");
		super.onPause();
	}

	@Override
	protected void onStart() {
		System.out.println("Activity1::onStart");
		super.onStart();
	}

	@Override
	protected void onRestart() {
		System.out.println("Activity1::onRestart");
		super.onRestart();
	}

	@Override
	protected void onStop() {
		System.out.println("Activity1::onStop");
		super.onStop();
	}

	@Override
	protected void onDestroy() {
		System.out.println("Activity1::onDestroy");
		super.onDestroy();
	}
}
